package com.study.abstractfactory.factory;

import com.study.abstractfactory.product.*;

/**
 * @ClassName: ShapeFactory
 * @Description: 形状工厂
 * @Details:
 * @Author: 郑港旭
 * @Create: 2021-11-16 09:43
 **/
public class ShapeFactory extends AbstractFactory{
    @Override
    public Color getColor(String color) {
        return null;
    }

    @Override
    public Shape getShape(String shape) {
        if (shape == null){
            return null;
        }
        if (shape.equals("CIRCLE")){
            return new Circle();
        } else if (shape.equals("RECTANGLE")){
            return new Rectangle();
        } else if (shape.equals("SQUARE")){
            return new Square();
        }
        return null;
    }
}
